<?php if ($news_cate=="van-ban-phap-quy"){ ?>
<ul id="nav">
	<?php
		foreach ($aNewsCate as $key => $item):
	?>
  	<li <?php if ($news_subcate_id == $item->cate_id) echo "class=\"current\"";?>><a href="<?php echo $base_url.$news_cate."/".$item->url."-".$item->cate_id;?>"><?php echo $item->cate_name;?></a></li>
  <?php	
		endforeach;
	?>	    
</ul>
<?php } ?>
<!-- tin moi nhat -->
<div id="latest-title">
    <span class="title"><?php echo $page_title; ?></span>
    <img src="<?php echo $img_url; ?>style/images/img28.gif">
    <div class="ico-social">
        <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $current_url; ?>&display=popup&ref=plugin" target="_blank"><img src="<?php echo $img_url; ?>style/images/imgfb.gif" width="16" height="16" border="0"></a>
        <a href="https://twitter.com/share" target="_blank"><img src="<?php echo $img_url; ?>style/images/imgtw.gif" width="16" height="16" border="0"></a>
        <a href="https://plus.google.com/share?url=<?php echo $current_url; ?>" target="_blank"><img src="<?php echo $img_url; ?>style/images/imggp.gif" width="16" height="16" border="0"></a>
        <a href="javascript:void(0);" onclick="return openPopup('contactForm')"><img src="<?php echo $img_url; ?>style/images/imgma.gif" width="16" height="16" border="0"></a>
        <a href="javascript:void(0);" onclick="javascript:window.print();"><img src="<?php echo $img_url; ?>style/images/imgpr.gif" width="16" height="16" border="0"></a>
        <span class="time">
            <?php
            //show date time Tieng Viet
            $str_search = array(
                "Mon",
                "Tue",
                "Wed",
                "Thu",
                "Fri",
                "Sat",
                "Sun"
            );
            $str_replace = array(
                "Th&#7913; hai",
                "Th&#7913; ba",
                "Th&#7913; t&#432;",
                "Th&#7913; n&#259;m",
                "Th&#7913; s&#225;u",
                "Th&#7913; b&#7843;y",
                "Ch&#7911; nh&#7853;t"
            );
            $timenow = gmdate("D, d/m/Y | H:i", time() + 7 * 3600);
            $timenow = str_replace($str_search, $str_replace, $timenow);
            echo $timenow;
            ?>      
        </span>
    </div>
</div>  
<div id="seperator"></div>
<!-- box: record đầu tiên -->
<?php
if (isset($aNews) && count($aNews) > 0) {
	if ($news_cate!="van-ban-phap-quy"){
    $parent_cate_url = "";
    if ($aNews[0]->parent_cate_url != "")
        $parent_cate_url = $aNews[0]->parent_cate_url . "/";
    ?>    
    <div id="news-first">
        <ul>
            <li class="left"><a href="<?php echo $base_url . $parent_cate_url . $aNews[0]->news_cate_url . "/" . $aNews[0]->url . "-" . $aNews[0]->news_id; ?>.html" class="title"><img src="<?php echo $img_url; ?>style/<?php echo $aNews[0]->img_thumb3; ?>" width="240" height="155" border="0"></a></li>
            <li class="right">
                <a href="<?php echo $base_url . $parent_cate_url . $aNews[0]->news_cate_url . "/" . $aNews[0]->url . "-" . $aNews[0]->news_id; ?>.html" class="title"><?php echo $aNews[0]->title; ?></a> <br />
                <span class="time"><?php echo $aNews[0]->display_date; ?></span>
                <span class="content"><?php echo $aNews[0]->short_desc; ?></span>
            </li>
        </ul>
        <div class="clearfix"></div> 
    </div>
    <!-- box: record thứ 2 ... n -->
    <div id="news-itemlist">
        <div class="item">
            <ul>
                <?php
                array_shift($aNews); //next record
                foreach ($aNews as $key => $item):
                    if ($item->parent_cate_url != "")
                        $parent_cate_url = $item->parent_cate_url . "/";
                    ?>        
                    <li class="left"><a href="<?php echo $base_url . $parent_cate_url . "/" . $item->news_cate_url . "/" . $item->url . "-" . $item->news_id; ?>.html" class="title"><img src="<?php echo $img_url; ?>style/<?php echo $item->img_thumb2; ?>" width="140" height="90" border="0"></a></li>
                    <li class="right">
                        <a href="<?php echo $base_url . $parent_cate_url . $item->news_cate_url . "/" . $item->url . "-" . $item->news_id; ?>.html" class="title"><?php echo $item->title; ?></a> 
                        <span class="time"><?php echo $item->display_date; ?></span>
                        <span class="content"><?php echo $item->short_desc; ?></span>
                    </li>
                    <div class="clearfix"></div>
                    <div id="seperator2"></div>
                    <?php
                    $parent_cate_url = "";
                endforeach;
                ?>          
            </ul>
        </div>
    </div> 
		<div id="news-paging">
        <?php echo $paging; ?>
      <!--<span class="page-status">Trang <?php echo $cur_page; ?> của 90</span>-->
    </div>
    <?php
	}
	else
	{
	?>
  <br>
	<table width="670" border="0" cellspacing="1" cellpadding="0" bgcolor="#CCCCCC" class="van-ban-phap-quy">
    <tr height="30px">
      <td bgcolor="#FFFFFF" width="40" class="cell" align="center"><strong>STT</strong></td>
      <td bgcolor="#FFFFFF" width="140" class="cell" align="center"><strong>Số công văn</strong></td>
      <td bgcolor="#FFFFFF" width="100" class="cell" align="center"><strong>Ngày ban hành</strong></td>
      <td bgcolor="#FFFFFF" width="100" class="cell" align="center"><strong>Ngày hiệu lực</strong></td>
      <td bgcolor="#FFFFFF" width="290" class="cell" align="center"><strong>Nội dung</strong></td>
    </tr>  
  <?php
		$i = $pagesize*($cur_page-1)+1;
		foreach ($aNews as $key => $item):
	?>
    <tr>
      <td bgcolor="#FFFFFF" width="40" class="cell">
      <div style="padding:8px; text-align:center;">
			<?php echo $i;?>
      </div>      
      </td>
      <td bgcolor="#FFFFFF" width="140" class="cell">
      <div style="padding:8px;">
			<?php echo $item->title;?>
      </div>
      </td>
      <td bgcolor="#FFFFFF" width="100" class="cell">
      <div style="padding:8px;">
			<?php echo date("Y-m-d", strtotime($item->create_date));?>
      </div>
      </td>
      <td bgcolor="#FFFFFF" width="100" class="cell">
      <div style="padding:8px;">
      <?php echo date("Y-m-d", strtotime($item->display_date));?>
      </div>      
      </td>
      <td bgcolor="#FFFFFF" width="290" class="cell">
      <div style="padding:8px;">
			<?php echo $item->short_desc;?>
      <?php
				if ($item->file != ""){
			?>
      <br>
      <a class="vbpq-downloadfile" href="<?php echo $img_url."style/".$item->file; ?>" target="_blank"><img src="<?php echo $img_url; ?>style/images/Save-icon.png" border=0> Tải về</style>
      <?php
				}
			?>
      </div>      
      </td>      
    </tr>
  <?php
			$i++;
		endforeach;
	?>
  </table>
  <div id="news-paging">
      <?php echo $paging; ?>
    <!--<span class="page-status">Trang <?php echo $cur_page; ?> của 90</span>-->
  </div>  
  <?php
	}
}
else
    echo "<br><br><div align='center' class='nodata'>" . $page_nodata . "</div>";
?>     
<!-- end of FAQ -->
<br><br>
